package com.base.study04_collection;

import org.junit.Test;

import java.sql.Timestamp;
import java.util.*;

/**
 * ClassName: ValueOfMapSort
 * PackageName: com.cwy.study04_collection
 * Describe:
 *
 * @author: Cheng Wenying
 * @Create: 2024/1/17
 * @version:
 */

public class ValueOfMapSort {
    @Test
    public void test() {
        Map map = new HashMap<>();
        map.put("a", "福州");
        map.put("d", "厦门");
        map.put("b", "厦门");
        map.put("c", "宁德");
        map.put("sss", 2);
//        Collection<String> values = map.values();
//        ArrayList<String> integers = new ArrayList<>(values);
//        Collections.sort(integers);
//        System.out.println(integers);
//        new ArrayList<>();
        Object s = 103101;
        Integer ss = (Integer)s;
        if(ss.toString().length() == 6){
            Integer s1 = Integer.parseInt(ss.toString().substring(0,3));
            Integer s2 = Integer.parseInt(ss.toString().substring(3,6));
            map.put("name", getRegionName(s1) + ";" + getRegionName(s2));
        }
        System.out.println(map.entrySet());

        Timestamp time = new Timestamp(1692633600000L);
        Date time1 = time;
        System.out.println(time1);
        System.out.println(time1.getTime());


    }
    private String getRegionName(int id) {
        switch (id) {
            case 30:
                return "华东";
            case 35:
                return "省超";
            case 101:
                return "福州";
            case 102:
                return "厦门";
            case 103:
                return "宁德";
            case 104:
                return "莆田";
            case 105:
                return "泉州";
            case 106:
                return "漳州";
            case 107:
                return "龙岩";
            case 108:
                return "三明";
            case 109:
                return "南平";
        }
        return "";
    }
}
